using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using FEL.BOD;
using FEL.COM;


public partial class COM_COM_ARTICULO_BARRA : PaginaBaseKCG
{
    public Com_Articulo Com_Articulo_Actual
    {
        get
        {
            if (ViewState["COM_ARTICULO"] == null)
                ViewState["COM_ARTICULO"] = ObtenerComArticulo();
            return (Com_Articulo)ViewState["COM_ARTICULO"];
        }
    }

    Com_Articulo ObtenerComArticulo()
    {
        FEL.COM.BO_Com_Articulo datos = new BO_Com_Articulo();
        return datos.GetById("", Scope, Request.QueryString["Com_Articulo_Id"])[0];
    }

    
    protected void Page_Load(object sender, EventArgs e)
    {
        //Fv.DataBound += new EventHandler(fvcomarticulobarra_DataBound);
        base.Page_Load(sender, e);
        cargarBotones();
    }

    private void cargarBotones()
    {
        BtnArticulo.Text = GetLocalResourceObject("Btn_Com_Articulo_Barra_ArticuloRecursoKCG.Text").ToString();
        BtnArticulo.ToolTip = GetLocalResourceObject("Btn_Com_Articulo_Barra_ArticuloRecursoKCG.ToolTip").ToString();
    }

    protected override CheckBox CbInsertarMemoria
    {
        get { return null; }
    }

    protected override Type TipoObjeto
    {
        get { return typeof(global::Com_Articulo_Barra); }
    }

    protected override GridView Gv
    {
        get { return gvcomarticulobarra; }
    }

    protected override FormView Fv
    {
        get { return fvcomarticulobarra; }
    }

    protected override ObjectDataSource OdsGv
    {
        get { return odsgvcom_articulo_barra; }
    }

    protected override ObjectDataSource OdsDv
    {
        get { return odsCom_Articulo_Barra; }
    }

    protected override Button BResponderZoom
    {
        get { return Seleccionar; }
    }

    protected override Button BRegreso
    {
        get { return Atras; }
    }


    protected override Koala.KoalaWebControls.KFiltro KftFiltro
    {
        get { return kftFiltro; }
    }
    protected override string Contenedor
    {
        get { return "COM_ARTICULO_BARRA"; }
    }

    protected void nav_Siguiente(object sender, EventArgs e)
    {
        Gv_SelectedIndexChanged(sender, e);
    }

    protected override void DefinirParametrosFijosDeInsercion(System.Collections.Generic.List<DictionaryEntry> param)
    {
        if (Request.QueryString.Count > 0)
        {
            param.Add(new DictionaryEntry("Com_Articulo_Id", Request.QueryString["Com_Articulo_Id"]));
            param.Add(new DictionaryEntry("Com_Articulo_Codigo", Com_Articulo_Actual.Codigo));
            param.Add(new DictionaryEntry("Com_Articulo_Nombre", Com_Articulo_Actual.Nombre));
        }
        base.DefinirParametrosFijosDeInsercion(param);
    }

    protected void BtnArticulo_Click(object sender, EventArgs e)
    {
        TextBox ArticuloId = (TextBox)Fv.FindControl("Com_Articulo_Id");
        TextBox ArticuloCodigo = (TextBox)Fv.FindControl("Com_Articulo_Codigo");
        TextBox ArticuloNombre = (TextBox)Fv.FindControl("Com_Articulo_Nombre");
        Response.Redirect("~/COM/COM_ARTICULO.aspx?Com_Articulo_id=" + ArticuloId.Text + "&Com_Articulo_Codigo=" + ArticuloCodigo.Text + "&Com_Articulo_Nombre=" + ArticuloNombre.Text);
    }
}
